home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / Thing / CWeaponFBAA.as < prev    next >
Text File  |  2011-08-19  |  3KB  |  123 lines

  1. package Local.Game.Thing
  2. {
  3.    import Local.Game.World.CAngle;
  4.    import Local.Game.World.CPosition;
  5.    
  6.    public class CWeaponFBAA extends CWeapon
  7.    {
  8.       
  9.       public static var _Upgrades:Array;
  10.       
  11.       {
  12.          if(true)
  13.          {
  14.             _Upgrades = [{
  15.                "mName":"",
  16.                "mAmmo":INFINATEAMMO,
  17.                "mAutoFire":true,
  18.                "mFireRate":5,
  19.                "mDamage":100,
  20.                "mRange":INFINATERANGE
  21.             }];
  22.          }
  23.       }
  24.       
  25.       private var mGunIndex:int;
  26.       
  27.       public function CWeaponFBAA()
  28.       {
  29.          super();
  30.          ┬º┬ºpush(┬º┬ºfindproperty(mAngleRange));
  31.          ┬º┬ºpush("min");
  32.          ┬º┬ºpush(-90 * 256);
  33.          if(true)
  34.          {
  35.             ┬º┬ºpush(┬º┬ºpop() / 360);
  36.          }
  37.          ┬º┬ºpop().mAngleRange = null;
  38.          mTargetAngle = new CAngle();
  39.          mUpgrade = 0;
  40.          mFireRate = Math.floor(mFireRate / mEnemySpeed);
  41.          mType = "gunfbaa";
  42.          Process = Process_Normal;
  43.          mGunIndex = 0;
  44.          mOrientation = 1;
  45.          AddAnimation("stand",TruckFlatbedAA_Gun,"AddSprite_Black");
  46.          AddSound("fire_0",AA_Gun_Fire_1);
  47.          AddSound("fire_1",AA_Gun_Fire_2);
  48.          AddSound("fire_2",AA_Gun_Fire_3);
  49.       }
  50.       
  51.       override public function Fire() : void
  52.       {
  53.          AddThing(new CShotBullet(GetShotPosition("gun" + (mGunIndex + 1)),mAngle.mDelta,20));
  54.          mAnimationFrame = (mGunIndex + 1) * 0.25;
  55.          ┬º┬ºpush(┬º┬ºfindproperty(mGunIndex));
  56.          ┬º┬ºpush(mGunIndex + 1);
  57.          if(true)
  58.          {
  59.             ┬º┬ºpush(┬º┬ºpop() % 3);
  60.          }
  61.          ┬º┬ºpop().mGunIndex = ┬º┬ºpop();
  62.          PlaySound("fire_" + mGunIndex);
  63.          IncrementFired();
  64.       }
  65.       
  66.       public function SetTarget(param1:CThingMain) : Boolean
  67.       {
  68.          if(true)
  69.          {
  70.             mCurrentTarget = param1;
  71.          }
  72.          return true;
  73.       }
  74.       
  75.       public function GetShotPosition(param1:String) : CPosition
  76.       {
  77.          return GetObjectPosition(param1,mPosition);
  78.       }
  79.       
  80.       override public function get mWeaponName() : String
  81.       {
  82.          return "gunm1a1";
  83.       }
  84.       
  85.       override public function Draw() : void
  86.       {
  87.          super.Draw();
  88.          DrawSprite(GetOrientationMatrix());
  89.       }
  90.       
  91.       public function Process_Normal() : void
  92.       {
  93.          var _loc1_:CAngle = null;
  94.          var _loc2_:CPosition = null;
  95.          if(true)
  96.          {
  97.             if(mCurrentTarget)
  98.             {
  99.                _loc2_ = CPosition.SUBTRACT(mCurrentTarget.mCollide.mMid,mPosition);
  100.                if(true)
  101.                {
  102.                   mTargetAngle.mDelta = _loc2_;
  103.                }
  104.             }
  105.             else
  106.             {
  107.                mTargetAngle.mAngle256 = -(64 + 32);
  108.             }
  109.          }
  110.          _loc1_ = new CAngle(mTargetAngle.mAngle - mAngle.mAngle);
  111.          mAngle.mAngle += _loc1_.mAngle * 0.5;
  112.          mAnimationFrame = 0;
  113.          WeaponUpdate();
  114.          Process_Children();
  115.       }
  116.       
  117.       override public function get mUpgrades() : Array
  118.       {
  119.          return _Upgrades;
  120.       }
  121.    }
  122. }
  123.